package com.unknowpupil.design.factory.impl;

/**
 * @Description: 简单工厂模式<br/>
 * <p>
 *
 * </p>
 * @Author: <a> w10g </a>
 * @CreateDate: Create in 2020/4/24 15:04
 * @Classname: UserFactory
 * @Version: 1.0
 */
class UserFactory {
    public static Object create(String type) throws Exception {
        switch (type) {
            case 1+"" : return new User();
            case 2+"" : return new Number();

            default:
                throw new Exception("传递的用户类型错误");
        }
    }
}
